// @ts-nocheck
import React, { Component } from 'react';
import MyNavLink from '../../components/MyNavLink';
import { Routes, Route, Navigate } from 'react-router-dom'
import Message from './Message';
import News from './News'


class Home extends Component {

  render() {
    return (
      <div>
        <h2>home</h2>
        <ul className="nav nav-tabs">
          <li>
            <MyNavLink to='/home/news'>News</MyNavLink>
          </li>
          <li>
            <MyNavLink to='/home/message'>Message</MyNavLink>
          </li>
        </ul>
        {/* 注册路由 */}
        <Routes>
          <Route path='/news' element={<News />} />
          <Route path='/message/*' element={<Message />} />
          <Route path="/" element={<Navigate to="/home/news"/>}/>
        </Routes>
      </div>
    );
  }
}

export default Home;
